home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pOrigSprite, pSodaMenu
- global gSodaIngredientsList
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- mHidePopup(me)
- pSodaMenu = EMPTY
- repeat with X = 1 to count(gSodaIngredientsList)
- put getname(getPropAt(gSodaIngredientsList, X)) && "(" & gSodaIngredientsList[X][#key] & ")" & RETURN after pSodaMenu
- end repeat
- delete char -30000 of pSodaMenu
- customFont(pSpr.member)
- end
-
- on mShowPopup me, origSprite
- pOrigSprite = origSprite
- pSpr.locH = the mouseH
- pSpr.locV = min(the mouseV, (the stage).rect.height - pSpr.member.height - 15)
- pSpr.loc = pSpr.loc - 10
- pSpr.member.text = pSodaMenu
- end
-
- on rightMouseDown me
- if the stage = the activeWindow then
- mouseDown(me)
- end if
- end
-
- on mouseDown me
- thisLine = the mouseLine
- if thisLine > 0 then
- newIngredient = getPropAt(gSodaIngredientsList, thisLine)
- sendSprite(pOrigSprite, #mChangeSoda, newIngredient)
- end if
- mHidePopup(me)
- end
-
- on mouseWithin me
- thisLine = the mouseLine
- if thisLine > 0 then
- hilite line thisLine of field the member of pSpr
- end if
- end
-
- on mouseLeave me
- mHidePopup(me)
- end
-
- on mHidePopup me
- pSpr.locH = 1000
- end
-
- on endSprite
- end
-